import request from '@/utils/request'

// 创建报工
export function createReportWork(data) {
  return request({
    url: '/production/report-work/create',
    method: 'post',
    data: data
  })
}

// 更新报工
export function updateReportWork(data) {
  return request({
    url: '/production/report-work/update',
    method: 'put',
    data: data
  })
}

// 删除报工
export function deleteReportWork(id) {
  return request({
    url: '/production/report-work/delete?id=' + id,
    method: 'delete'
  })
}

/** 批量删除报工 */
export function deleteReportWorkList(ids) {
  return request({
    url: `/production/report-work/delete-list?ids=${ids.join(',')}`,
    method: 'delete'
  })
}

// 获得报工
export function getReportWork(id) {
  return request({
    url: '/production/report-work/get?id=' + id,
    method: 'get'
  })
}

// 获得报工分页
export function getReportWorkPage(params) {
  return request({
    url: '/production/report-work/page',
    method: 'get',
    params
  })
}
// 导出报工 Excel
export function exportReportWorkExcel(params) {
  return request({
    url: '/production/report-work/export-excel',
    method: 'get',
    params,
    responseType: 'blob'
  })
}